<script setup lang="ts">
import { formatSeconds } from '@libc/shared';
import { ref } from 'vue';

console.log(formatSeconds(100000));

const list = ref<any[]>([]);

const getUserList = async () => {
  const res = await fetch('http://localhost:3000/api/user');
  const data = await res.json();
  list.value = data.data;
};
</script>

<template>
  <h1>Vue Dome</h1>
  <button @click="getUserList">获取用户列表</button>
  <ul>
    <li v-for="item in list" :key="item.id">{{ item.name }}</li>
  </ul>
</template>

<style scoped>
h1 {
  color: red;
}
</style>
